

export function setShengDiao(text: string, i?: number) {
    if (!i) {
        return text
    }
    const shengdiao = {
        a: ['ā', 'á', 'ǎ', 'à'],
        o: ['ō', 'ó', 'ǒ', 'ò'],
        e: ['ē', 'é', 'ě', 'è'],
        i: ['ī', 'í', 'ǐ', 'ì'],
        u: ['ū', 'ú', 'ù', 'ù'],
        ü: ['ǖ', 'ǘ', 'ǚ', 'ǜ'],
    }
    let _: 'a' | 'o' | 'e' | 'i' | 'u' | 'ü';
    if (text.indexOf('a') > -1) {
        _ = 'a';
    }
    else if (text.indexOf('o') > -1) {
        _ = 'o';
    }
    else if (text.indexOf('e') > -1) {
        _ = 'e';
    }
    else if (text.indexOf('i') > -1 || text.indexOf('u') > -1) {
        if (text.indexOf('i') > -1 && text.indexOf('u') === -1) {
            _ = 'i'
        } else if (text.indexOf('u') > -1 && text.indexOf('i') === -1) {
            _ = 'u'
        } else {
            if (text.indexOf('u') > text.indexOf('i')) {
                _ = 'u'
            } else {
                _ = 'i'
            }
        }
    } else if (text.indexOf('ü') > -1) {
        _ = 'ü';
        if (text.indexOf('j') > -1 || text.indexOf('q') > -1 || text.indexOf('x') > -1 || text.indexOf('y') > -1) {
            _ = 'u';
            text = text.replace('ü', 'u')
        }
    } else {
        _ = 'a';
    }
    text = text.replace(_, shengdiao[_][i - 1])
    return text;
}
function setShengDiaos(arr: Array<[string, number?]>) {
    return arr.map((item: [string, number?]) => {
        return setShengDiao(...item)
    })
}
export const words = {
    第10课: [
        { pinyin: setShengDiaos([['shi', 2], ['hou']]), wenzi: "时候" },
        { pinyin: setShengDiaos([['yi', 1], ['fu', 1]]), wenzi: "衣服" },
        { pinyin: setShengDiaos([['men', 2], ['ling', 2]]), wenzi: "门铃" },
        { pinyin: setShengDiaos([['lei', 2], ['sheng', 1]]), wenzi: "雷声" },
        { pinyin: setShengDiaos([['pan', 4], ['zhe',]]), wenzi: "盼着" },
        { pinyin: setShengDiaos([['kuai', 4], ['dian', 3]]), wenzi: "快点" },
        { pinyin: setShengDiaos([['ji', 4], ['xie', 2], ['dai', 4]]), wenzi: "系鞋带" },
        { pinyin: setShengDiaos([['xi', 1], ['wang', 4]]), wenzi: "希望" },
        { pinyin: setShengDiaos([['zhang', 3], ['da', 4]]), wenzi: "长大" },
    ],
    第11课: [
        { pinyin: setShengDiaos([['xiang', 4], ['lian', 4]]), wenzi: "项链" },
        // { pinyin: setShengDiaos([['da', 4], ['hai', 3]]), wenzi: "大海" },
        // { pinyin: setShengDiaos([['lan', 2], ['lan', 2], ['de']]), wenzi: "蓝蓝的" },
        // { pinyin: setShengDiaos([['xue', 3], ['bai', 2]]), wenzi: "雪白" },
        // { pinyin: setShengDiaos([['lang', 4], ['hua', 1]]), wenzi: "浪花" },
        // { pinyin: setShengDiaos([['huang', 2], ['huang', 2], ['de']]), wenzi: "黄黄的" },
        // { pinyin: setShengDiaos([['qiao', 1], ['qiao', 1]]), wenzi: "悄悄" },
        // { pinyin: setShengDiaos([['hai', 3], ['luo', 2]]), wenzi: "海螺" },
        // { pinyin: setShengDiaos([['bei', 4], ['ke', 2]]), wenzi: "贝壳" },
        // { pinyin: setShengDiaos([['xiao', 3], ['wa', 2], ['wa']]), wenzi: "小娃娃" },
        // { pinyin: setShengDiaos([['xi', 1], ['xi', 1], ['de']]), wenzi: "嘻嘻地" },
        // { pinyin: setShengDiaos([['cai', 3], ['se', 4]]), wenzi: "彩色" },
        // { pinyin: setShengDiaos([['xiong', 1], ['qian', 2]]), wenzi: "胸前" },
        // { pinyin: setShengDiaos([['kuai', 4], ['huo']]), wenzi: "快活" },
        // { pinyin: setShengDiaos([['sha', 1], ['tan', 1]]), wenzi: "沙滩" },
        // { pinyin: setShengDiaos([['jiao', 3], ['yin', 4]]), wenzi: "脚印" },
    ],
    第12课: [
        { pinyin: setShengDiaos([['xue', 3], ['di', 4]]), wenzi: "雪地" },
        { pinyin: setShengDiaos([['hua', 4], ['jia', 1]]), wenzi: "画家" },
        { pinyin: setShengDiaos([['ji', 1], ['ya', 1]]), wenzi: "鸡鸭" },
        { pinyin: setShengDiaos([['zhu', 2], ['ye', 4]]), wenzi: "竹叶" },
        { pinyin: setShengDiaos([['mei', 2], ['hua', 1]]), wenzi: "梅花" },
        { pinyin: setShengDiaos([['feng', 1], ['ye', 4]]), wenzi: "枫叶" },
        { pinyin: setShengDiaos([['yue', 4], ['ya', 2]]), wenzi: "月牙" },
        { pinyin: setShengDiaos([['yan', 2], ['liao', 4]]), wenzi: "颜料" },
        { pinyin: setShengDiaos([['qing', 1], ['wa', 1]]), wenzi: "青蛙" },
        { pinyin: setShengDiaos([['dong', 4], ['li', 3]]), wenzi: "洞里" },
        { pinyin: setShengDiaos([['shui', 4], ['zhao', 2]]), wenzi: "睡着" },
    ],
    第13课: [
        { pinyin: setShengDiaos([['wu', 1], ['ya', 1]]), wenzi: "乌鸦" },
        { pinyin: setShengDiaos([['he', 1], ['shui', 3]]), wenzi: "喝水" },
        { pinyin: setShengDiaos([['kou', 3], ['ke', 3]]), wenzi: "口渴" },
        { pinyin: setShengDiaos([['ping', 2], ['zi']]), wenzi: "瓶子" },
        { pinyin: setShengDiaos([['shi', 2], ['zi', 3]]), wenzi: "石子" },
        { pinyin: setShengDiaos([['jian', 3], ['jian', 3]]), wenzi: "渐渐" },
        { pinyin: setShengDiaos([['sheng', 1], ['gao', 2]]), wenzi: "升高" },
        { pinyin: setShengDiaos([['yi', 4], ['ke', 1]]), wenzi: "一颗" },
        { pinyin: setShengDiaos([['fang', 4], ['jin', 4], ['qu', 4]]), wenzi: "放进去" },
        { pinyin: setShengDiaos([['dao', 4], ['chu', 4]]), wenzi: "到处" },
    ],
    第14课: [
        { pinyin: setShengDiaos([['shui', 2]]), wenzi: "谁" },
        { pinyin: setShengDiaos([['wei', 3], ['ba', 1]]), wenzi: "尾巴" },
        { pinyin: setShengDiaos([['pang', 2], ['bian', 1]]), wenzi: "旁边" },
        { pinyin: setShengDiaos([['bi', 1], ['lü', 4]]), wenzi: "碧绿" },
        { pinyin: setShengDiaos([['cao', 3], ['mei', 2]]), wenzi: "草莓" },
        { pinyin: setShengDiaos([['wo', 1], ['niu', 2]]), wenzi: "蜗牛" },
        { pinyin: setShengDiaos([['mo', 1], ['gu', 1]]), wenzi: "蘑菇" },
        { pinyin: setShengDiaos([['qiu', 1], ['tian', 1]]), wenzi: "秋天" },
        { pinyin: setShengDiaos([['pa', 1], ['ya',]]), wenzi: "爬呀" },
        { pinyin: setShengDiaos([['hao', 3], ['jiu', 3]]), wenzi: "好久" },
        { pinyin: setShengDiaos([['gai', 4], ['zhe',], ['xue', 3]]), wenzi: "盖着雪" },
        { pinyin: setShengDiaos([['guo', 4], ['dong', 1]]), wenzi: "过冬" },
    ],
    "第15课": [
        { pinyin: setShengDiaos([['gong', 1], ['chang', 3]]), wenzi: '工厂' },
        { pinyin: setShengDiaos([['yi', 1], ['sheng', 1]]), wenzi: '医生' },
    ],
  
};

